<template>
  <div class='search'>
    <f-drawer ref='invoiceDrawer' title='市场结算支付' width='700' @submit='handleSubmit' @visibleChange='visibleChange'>
      <saleman-pay ref='form1' v-if="drawerVisible&&current=='form1'" @closeDrawer='closeDrawer'></saleman-pay>
    </f-drawer>
  </div>
</template>
<script>
import SalemanPay from "./saleman_pay"

export default {
  name: "SalemanPayDrawer",
  props: {},
  data() {
    return {
      refs: this.$refs,
      drawerVisible: false,
      isEdit: false,
      title: "",
      current: "form1",
      formData: {},
      forms: [
        "form1"
      ]
    }
  },
  methods: {
    showDrawer(data) {
      this.formData = data
      this.refs["invoiceDrawer"].show(data)
      this.tabClick("form1")
    },
    handleSubmit(callback) {
      this.refs[this.current].handleSubmit(callback)
    },
    visibleChange(drawerVisible) {
      this.drawerVisible = drawerVisible
    },
    closeDrawer() {
      this.$emit("success")
      this.$refs.invoiceDrawer.close()
    },
    tabClick(name) {
      this.current = name
      this.$nextTick(() => {
        this.refs[this.current].setData(this.formData)
      })
    }
  },
  created() {
  },
  components: { SalemanPay }
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
